programming4us
           
 
 
Sharepoint

SharePoint 2010 : Customizing Out of the Box Workflows

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
7/9/2013 3:52:03 AM

Out of the box workflows are great, and the biggest reason they are so great is because you don't have to write them. However, if you have business users like the ones I deal with, there will always request a minor tweak to an out of the box workflow, and then they give me puzzled looks when I give them a time estimate in weeks. In SharePoint 2007, out of the box workflows were pretty much sealed. They were what they were and you could not change them. In SharePoint 2010, however, you have the ability to tweak out of the box workflows and change them to your heart's content.

Let's take the example of the out of the box workflow. Say that you want to perform a minor tweak to an out of the box workflow. Specifically, the tweak you wish to do is that you don't want to display the CC Field in the initiation form. Also, since I'm not too fond of the colors used on the initiation form let's also change the colors of the inititiation form.

You have the ability of customizing out of the box workflows using SharePoint Designer. Open your site collection in SharePoint Designer and look at all the workflows available within this site. You should see the "Approval - SharePoint 2010" workflow available and you can double-click it and start editing it right through SharePoint Designer. What I like to do is to right-click an existing out of the box workflow definition, choose to make a copy, and then modify the copy. This way the original workflow definition remains intact, so someone else can use it later.

Therefore, right-click the "Approval - SharePoint 2010" workflow template and choose "Copy and Modify". By doing so, SharePoint Designer will ask you for a name of the copy, call it "Approval Copy". Also, SharePoint Designer will ask you which content type you want to limit this workflow to. This can be seen in Figure 1.

Figure 1. Associating the workflow to a particular content type

What you're doing here is creating a reusable workflow. This reusable workflow can be exported as a solution package. It can be imported into Visual Studio for further tweaking or it can be deployed across various other farms. When you create a reusable workflow through SharePoint Designer, you associate it with a content type. By associating a reusable workflow to a content type, you are essentially defining the structure of information that this workflow can always assume will be present. Therefore, if you associate the workflow with announcements, you can be sure that there will be a field called "Expires" because every announcement has an "Expires" field in it.

Any content type that inherits from announcement will be able to use your reusable workflow. Therefore, in order to create a globally reusable workflow, you should associate with the item content type. By doing so, you can be guaranteed that only the title field is present. This workflow can then be associated with any content type, since every content type eventually inherits from the item content type.

For this example, choose the content type to be "All" and click OK. The next screen will show you the workflow logic written out as a series of logical steps and conditions. This can be seen in Figure 2.

Figure 2. Workflow design in SharePoint Designer 2010

Let's say that at the very end of this workflow you wish to log to the history list that the workflow has finished executing. If you pay close attention to this logic tree, you will see an orange horizontal blinking cursor. By either using your cursor keys or by clicking the mouse left button, you have the ability to move that orange cursor. Take that cursor to the very end of the workflow, as shown in Figure 3.

Figure 3. I just moved my cursor to the end of the workflow.

With the cursor double-click it using the left button of your mouse. After a text box appears prompting you to start typing to search. Start typing "Log" and you will see that SharePoint Designer has narrowed your search to the Log to History list activity, as shown in Figure 4.

Figure 4. Picking a workflow activity in SharePoint Designer 2010

As prompted, hit enter to insert the necessary activity and then configure it to log a suitable message into the workflow history list. This can be seen in Figure 5.

Figure 5. A configured workflow activity in SharePoint Designer 2010

Go ahead and save this workflow. Now draw your attention to the ribbon, which shows a button that says "Export to Visio". Clicking on this button will allow you to export a .vwi file. Save this .vwi file at a convenient location on the disk.

Next, start Visio and create a new diagram under the flowchart category, based on the "Microsoft SharePoint Workflow" stencil. This visio diagram allows a business analyst to craft up an entire workflow from scratch entirely in Visio. This can be imported/exported back and forth from SharePoint Designer as many times as you please. You can experiment by creating a brand new workflow yourself using the Visio stencil, but I'm going to import the .vwi file you had exported from SharePoint Designer earlier. In Visio, go to the flowchart category and create a new diagram based on "Microsoft SharePoint Workflow". Once the diagram is created, in the ribbon under the process tab, look for the import and export buttons, as shown in Figure 6.

Figure 6. The import/export buttons for the SharePoint workflow

Click import and choose to import the .vwi file you had exported from SharePoint Designer earlier. You should see a graphical representation of your workflow in Figure 7.

Figure 7. Your created workflow depicted graphically in Visio

For a moment, I'd like you to stop here and compare this graphical representation with the Visio Services representation you saw earlier. You will see that the log to history list block is new. Therefore, this diagram accurately reflects my intent.

Again, I leave it up to you to experiment with this Visio stencil and the various workflow actions and conditions you can use in Visio and give those SharePoint flowcharts life as SharePoint workflows with SharePoint Designer.

Now come back to SharePoint Designer and let's make some additional tweaks to the approval copy workflow you were working on. There are two additional things I'd like to do to this workflow. I'd like to tweak the look of the infopath form and I'd like to eliminate the CC Field from the initiation form. In order to do so, open the approval copy workflow in SharePoint Designer and click the Initiation Form Parameters button in the ribbon. This form will allow you to add, modify, or remove various parameters for the workflow, and also choose which ones appear in the initiation form, association form, and which appear in both. Select the CC variable and choose to modify it by having it appear only in the association form. This can be seen in the Figure 8.

Figure 8. Modifying an out of the box workflow

The variables specified over here will also automatically generate the necessary InfoPath forms for you. Now double-click the InfoPath form under the "Forms" section of the workflow and make some modifications to the InfoPath form. Your modified infpath form should look like Figure 9.

Figure 9. Modified InfoPath form

Save this infopath farm anywhere on your machine. Then, publish it by clicking on the quick publish button next to the save button in the title bar of InfoPath.

Your modifications to the workflow are now complete. Click the edit workflow link one more time and from the ribbon choose to save and publish. Publishing the workflow will process all the necessary files, including the workflow visualization and the solution package, and will make the workflow available on the SharePoint site.

Just like before, create a new association to the "Approval Copy" workflow and run the workflow. Note the following:

  • The CC Field is no longer being asked for in the initiation form.

  • The workflow visualization now shows a log to history list activity at the end of the workflow.

  • The task form reflects the changes you had made previously.

  • In the workflow history, you should see a new comment saying "Workflow has finished executing", as shown in Figure 10.

Figure 10. The workflow history of the approval copy workflow
Other -----------------
- SharePoint 2010 : Out of the Box Workflows
- SharePoint 2010 : Office 2010 Client Applications (part 4)
- SharePoint 2010 : Office 2010 Client Applications (part 3) - Backstage
- SharePoint 2010 : Office 2010 Client Applications (part 2) - Documents and Data Caching
- SharePoint 2010 : Office 2010 Client Applications (part 1)
- Sharepoint 2010 : Content Management - In place Records Management
- Sharepoint 2010 : Content Management - Importing a Term Set
- Sharepoint 2010 : Content Management - Creating a Term Set
- Sharepoint 2010 : Content Management - Managing External Content Types
- Sharepoint 2010 : Content Management - Adding a Content Type hub
- SharePoint 2010 : Content Management - Configuring content deployment
- SharePoint 2010 : Content Management - Routing documents to another site
- SharePoint 2010 : Content Management - Configuring advanced routing
- Sharepoint 2010 : Backup and Restore (part 5) - Restoring from a backup in Central Administration
- Sharepoint 2010 : Backup and Restore (part 4) - Backing up a farm in Central Administration
- Sharepoint 2010 : Backup and Restore (part 3) - Importing sites, Recovering data from an unattached content database
- Sharepoint 2010 : Backup and Restore (part 2) - Performing a site collection backup, Exporting sites
- Sharepoint 2010 : Backup and Restore (part 1) - Recycle Bin settings in Central Administration
- Planning Your Move from SharePoint 2007 to 2010 : Upgrade and Migration Options
- Planning Your Move from SharePoint 2007 to 2010 : Planning Your Upgrade
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us